package com.lulu.baselib.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * created by xc on 2019/1/12 11:52
 * 日历工具
 */
public class CalendarUtil {

    static String[] pattarns = new String[]{
            "yyyy-MM-dd"
    };

    public static String getFormatStr(String pattern, Date date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        String format = simpleDateFormat.format(date);
        return format;
    }

    /**
     * 获取默认的日期字符串
     *
     * @return
     */
    public static String getDataStr() {
        String formatStr = getFormatStr(pattarns[0], new Date());
        return formatStr;
    }

}
